<?php
    include_once '../config.php';

    if ($_COOKIE['LOG'] == false) {
        header('Location: ../index.php');
    }

    include '../layout/header.php';
?>
<body>
    <div data-role="page">
        <div data-role="header" data-theme="b" class="ui-overlay-shadow">
            <h1>Verwaltung</h1>
            <a href="../index.php" data-role="button" data-icon="home" class="ui-btn-left" data-theme="a">Home</a>
        </div>
        <div data-role="content" data-theme="c">
            <ul class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" data-role="listview">
                <li class="ui-li ui-li-static ui-body-c ui-corner-top">
                    <table align="center">
                        <tr>
                            <td style="vertical-align: middle; text-align:center">
                                <strong style="color:green">Allgemeine Verwaltung</strong>.<br /><br />
                                Hier k&ouml;nnen Sie die angelegten Auftraggeber und deren Kaufm&auml;nner & Projektleiter bearbeiten.
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>
            <ul class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" data-role="listview">
                <li data-theme="b" data-icon="false"><a href="mainlist.php?list=cl">
                        <h3>Auftraggeber</h3>
                        <p>Bearbeiten</p>
                        <?php
                            $sql = "SELECT COUNT(client_id) AS anz FROM client";
                            $anz = mysql_fetch_array(mysql_query($sql));
                        ?>
                        <span class="ui-li-count" style="color:black; font-size:14px"><?php echo $anz['anz']; ?></span>
                </a></li>
                <li data-theme="b" data-icon="false"><a href="mainlist.php?list=pm">
                        <h3>Projektleiter</h3>
                        <p>Bearbeiten & L&ouml;schen</p>
                        <?php
                            $sql = "SELECT COUNT(pm_id) AS anz FROM project_manager WHERE km_or_pm = 'pm'";
                            $anz = mysql_fetch_array(mysql_query($sql));
                        ?>
                        <span class="ui-li-count" style="color:black; font-size:14px"><?php echo $anz['anz']; ?></span>
                </a></li>
                <li data-theme="b" data-icon="false"><a href="mainlist.php?list=km">
                        <h3>Kaufm&auml;nner</h3>
                        <p>Bearbeiten & L&ouml;schen</p>
                        <?php
                            $sql = "SELECT COUNT(pm_id) AS anz FROM project_manager WHERE km_or_pm = 'km'";
                            $anz = mysql_fetch_array(mysql_query($sql));
                        ?>
                        <span class="ui-li-count" style="color:black; font-size:14px"><?php echo $anz['anz']; ?></span>
                </a></li>
            </ul>
        </div>
        <div data-role="footer" data-theme="c">
            <h4>Eingeloggt als: <strong><?php echo $_COOKIE['VNAME'] . ' ' . $_COOKIE['NNAME']; ?></strong></h4>
        </div>
    </div>
</body>
</html>